<a href="<?php echo base_url('usuarios/cadastro') ?>" class="btn btn-add"><i class="icon-plus"></i> Novo usuário</a>

<?php if (count($usuarios)) { ?>
  <table class="table table-bordered table-hover">
    <colgroup>
      <col width="40%" />
      <col width="18%" />
      <col width="30%" />
      <col width="7%" />
    </colgroup>

    <thead>
      <tr>
        <th>Nome</th>
        <th>Login (CPF)</th>
        <th>Grupo</th>
        <?php if (preg_match("/Desenvolvedores|Administradores/", $this->session->userdata('grupo'))) { ?>
          <th></th>
        <?php } ?>
      </tr>
    </thead>

    <tbody>
      <?php foreach ($usuarios as $u) {
        $u->grupo = explode(",", $u->grupo); ?>
        <tr>
          <td><a href="<?php echo base_url('usuarios/cadastro/'.md5('MB'.$u->id.'SG')) ?>"><?php echo $u->nome ?></a></td>
          <td><a href="<?php echo base_url('usuarios/cadastro/'.md5('MB'.$u->id.'SG')) ?>"><?php echo cpf_format($u->login) ?></a></td>
          <td><a href="<?php echo base_url('usuarios/cadastro/'.md5('MB'.$u->id.'SG')) ?>">
            <?php foreach ($u->grupo as $g)
              echo "<div class=\"badge badge-inverse\">$g</div>"; ?>
          </a></td>
          <?php if (preg_match("/Desenvolvedores|Administradores/", $this->session->userdata('grupo'))) { ?>
            <td><a href="#" class="btn btn-small excluir" data-id="<?php echo md5('MB'.$u->id.'SG') ?>" title="Excluir" rel="tooltip"><i class="icon-remove"></i></a></td>
          <?php } ?>
        </tr>
      <?php } ?>
    </tbody>
  </table>
<?php } else { ?>
  <p class="well well-small"><i class="icon-exclamation-sign icon-large"></i> Não existem usuários cadastrados.</p>
<?php } ?>